const fs = require('fs-extra')
const path = require('path')
module.exports = function (creater, params, helper, cb) {
    const { projectName, description, template, typescript, date, src, css } = params
    const configDirName = 'config'
    const cwd = process.cwd()
    const projectPath = path.join(cwd, projectName)
    const sourceDir = path.join(projectPath, src)
    const configDir = path.join(projectPath, configDirName)

    const styleExtMap = {
        sass: 'scss',
        less: 'less',
        stylus: 'styl',
        none: 'css'
    }
    const currentStyleExt = styleExtMap[css] || 'css'
    fs.mkdirSync(projectPath)
    fs.mkdirSync(sourceDir)
    fs.mkdirSync(configDir)


    creater.template(template, 'test', path.join(sourceDir, 'pages', 'index', 'index.js'), {
        css: currentStyleExt
    })

    creater.fs.commit(() => {
        console.log()
    })

}